package com.yunhe.abnormal.domain.base;

import com.yunhe.common.constant.LanguageConsts;
import com.yunhe.common.i18n.I18nMessageUtil;
import com.yunhe.common.i18n.LanguageHolder;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.neo4j.ogm.annotation.GeneratedValue;
import org.neo4j.ogm.annotation.Id;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Property;

/**
 * 告警级别
 * @author duanxiaoyong
 */
@ApiModel(value = "AlarmLevel", description = "告警等级")
@NodeEntity
public class AlarmLevel {
    @ApiModelProperty(value = "告警等级ID")
    @Id
    @GeneratedValue
    private Long id;
    @ApiModelProperty(value = "告警等级CODE")
    @Property(name = "code")
    private Long code;
    @ApiModelProperty(value = "告警等级编号")
    @Property(name = "name")
    private String name;
    @ApiModelProperty(value = "告警等级标题")
    @Property(name = "title")
    private String title;
    @ApiModelProperty(value = "描述")
    @Property(name = "description")
    private String description;
    @ApiModelProperty(value = "是否可用")
    @Property(name = "activity")
    private Boolean activity;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getCode() {
        return code;
    }

    public void setCode(Long code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTitle() {
        if (LanguageConsts.TYPE.EN.value().equals(LanguageHolder.getLanguage())) {
            return I18nMessageUtil.getMessage(LanguageHolder.getLanguage(), title);
        } else {
            return title;
        }
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Boolean getActivity() {
        return activity;
    }

    public void setActivity(Boolean activity) {
        this.activity = activity;
    }
}
